package calao.plan;

import calao.storage.Record;

class TaskRef {
	
	// record associated with the task
	final Record record;
	// resource schedule
	final Schedule schedule;
	
	long start;
	long end;

	final int pool;
	final int doer;
	final int priority;
	
	// dependency level
	int depLevel;
	
	TaskRef(Record record, Schedule schedule) 
	{
		this.record = record;
		this.schedule = schedule;
		pool = SchedulePool.getPool(record);
		start = record.getLong(TaskDB.START);
		end = record.getLong(TaskDB.END);
		priority = record.getInt(TaskDB.PRIORITY);
		doer = record.getInt(TaskDB.RESOURCE);
	}
	
	int getId()
	{
		return record.getInt(TaskDB.ID);
	}
	
}
